package com.blb.community_admin.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.community_admin.entity.ZyBuilding;
import com.blb.community_admin.entity.ZyCommunity;
import com.blb.community_admin.mapper.ZyBuildingMapper;
import com.blb.community_admin.service.IZyBuildingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ZyBuildingServiceImpl extends ServiceImpl<ZyBuildingMapper, ZyBuilding> implements IZyBuildingService {

    @Resource
    private ZyBuildingMapper zyBuildingMapper;

    /**
     * 查询所有
     * @return
     */
    @Override
    public List<ZyBuilding> selectBuilding() {
        return zyBuildingMapper.selectBuilding();
    }

    /**
     * 模糊查询加分页
     * @param
     * @param
     * @param
     * @param
     * @return
     */
    @Override
    public IPage<ZyBuilding> selectBuildingPage(Long current, long size, ZyBuilding zyBuilding) {
        return zyBuildingMapper.selectBuidingPage(new Page<ZyBuilding>(current,size),zyBuilding);
    }

    /**
     * 获取小区信息
     * @return
     */
    @Override
    public List<ZyCommunity> getAllCommunity() {
        return zyBuildingMapper.getAllCommunity();
    }
}
